#include<time.h>
#include<string>
#include<iostream>



using namespace std;
string Getcurtime()
{
    time_t tm= time(nullptr);
    struct tm*cur= localtime(&tm);
    char arr[32];
    snprintf(arr,sizeof(arr),"%d-%d-%d %d:%d:%d",
             cur->tm_year+1900,
             cur->tm_mon + 1,
             cur->tm_mday,
             cur->tm_hour,
             cur->tm_min,
             cur->tm_sec);
    return arr;
}


std::string GetCurrTime()
{
    time_t t = time(nullptr);
    struct tm *curr = ::localtime(&t);

    char currtime[32];
    snprintf(currtime, sizeof(currtime), "%d-%d-%d %d:%d:%d",
             curr->tm_year + 1900,
             curr->tm_mon + 1,
             curr->tm_mday,
             curr->tm_hour,
             curr->tm_min,
             curr->tm_sec);
    return currtime;
}
